package com.yz.app.sale.view.activity;

import android.support.v4.app.Fragment;
import android.support.v7.widget.Toolbar;
import android.widget.RadioGroup;

import com.yz.app.sale.R;
import com.yz.app.sale.base.BaseActivity;
import com.yz.app.sale.utils.FragmentTabUtils;
import com.yz.app.sale.view.fragment.FindFragment;
import com.yz.app.sale.view.fragment.HomeFragment;

import java.util.ArrayList;

import butterknife.BindView;

public class MainActivity extends BaseActivity {
    @BindView(R.id.main_rgs)
    RadioGroup rgs;
    @BindView(R.id.main_toolbar)
    Toolbar mainToolbar;

    @Override
    public int getLayoutId() {
        return R.layout.activity_main;
    }

    @Override
    public void initView() {
        setSupportActionBar(mainToolbar);
        ArrayList<Fragment> fragments = new ArrayList<>();
        fragments.add(FindFragment.newInstance());
        fragments.add(HomeFragment.newInstance());
        fragments.add(HomeFragment.newInstance());
        fragments.add(HomeFragment.newInstance());
        new FragmentTabUtils(getSupportFragmentManager()
                , fragments
                , R.id.main_fragment_container
                , rgs)
        .setDefaultPostion(0);
        mainToolbar.setOnClickListener(v -> {

        });
    }
}
